package net.lijingye.education.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import net.lijingye.education.entity.FriendRequest;
import net.lijingye.education.util.CommonUtil;

/**
 * Created by LijingYe on 2016/3/26.
 */
public class FriendRequestVO {
    @JSONField(name = "id", ordinal = 0, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String id;
    @JSONField(name = "userId", ordinal = 1, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String userId;
    @JSONField(name = "userName", ordinal = 2, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String userName;
    @JSONField(name = "userFaceIcon", ordinal = 3, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String userFaceIcon;
    @JSONField(name = "userHome", ordinal = 4, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String userHome;

    public FriendRequestVO(FriendRequest friendRequest){
        this.id=String.valueOf(friendRequest.getId());
        this.userId=friendRequest.getUser().getId();
        this.userName= CommonUtil.getUserDisplayName(friendRequest.getUser());
        this.userFaceIcon=friendRequest.getUser().getFaceIcon();
        this.userHome=CommonUtil.getUserHomeText(friendRequest.getUser());
    }

    public FriendRequestVO(String id, String userId, String userName, String userFaceIcon, String userHome) {
        this.id = id;
        this.userId = userId;
        this.userName = userName;
        this.userFaceIcon = userFaceIcon;
        this.userHome = userHome;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserFaceIcon() {
        return userFaceIcon;
    }

    public void setUserFaceIcon(String userFaceIcon) {
        this.userFaceIcon = userFaceIcon;
    }

    public String getUserHome() {
        return userHome;
    }

    public void setUserHome(String userHome) {
        this.userHome = userHome;
    }

    @Override
    public String toString() {
        return "FriendRequestVO{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", userFaceIcon='" + userFaceIcon + '\'' +
                ", userHome='" + userHome + '\'' +
                '}';
    }
}
